Consolidate the preferable use of a pragma with the feature detection
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 25 Sep 2006 08:36:11 +0000 (09:36 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 25 Sep 2006 08:36:11 +0000 (09:36 +0100)
in the make script.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/arch/x86/Rules.mk
xen/include/xen/compiler.h

index 32c8e026951a9029cd2d3286a376d7916a04454a..176d6aebf415b7adf46542940ffe286d120b82f8 100644 (file)
@@ -44,7 +44,7 @@ CFLAGS  += -mno-red-zone -fpic -fno-reorder-blocks
 CFLAGS  += -fno-asynchronous-unwind-tables
 # -fvisibility=hidden reduces -fpic cost, if it's available
 CFLAGS  += $(shell $(CC) -v --help 2>&1 | grep " -fvisibility=" | \
-             grep -q hidden && echo "-fvisibility=hidden")
+             grep -q hidden && echo "-DGCC_HAS_VISIBILITY_ATTRIBUTE")
 LDFLAGS += -m elf_x86_64
 x86_32 := n
 x86_64 := y
index d70833efb54cb037c68200dc20de9b6443e155e2..85d6cee5f14ffc077df652cb733deb7c606430be 100644 (file)
@@ -35,7 +35,7 @@
 #define offsetof(a,b) ((unsigned long)&(((a *)0)->b))
 #endif
 
-#if defined(__x86_64__) && (__GNUC__ > 3)
+#ifdef GCC_HAS_VISIBILITY_ATTRIBUTE
 /* Results in more efficient PIC code (no indirections through GOT or PLT). */
 #pragma GCC visibility push(hidden)
 #endif